﻿Public Class control
    Public Sub OpenFormDetail(CurrentForm As Form, TargetForm As Form)
        TargetForm.SuspendLayout()
        TargetForm.MdiParent = CurrentForm.MdiParent
        TargetForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedToolWindow
        TargetForm.ForeColor = Color.Black
        TargetForm.BackColor = Color.White
        TargetForm.ShowIcon = False
        TargetForm.ShowInTaskbar = False
        TargetForm.ControlBox = False
        TargetForm.MaximizeBox = False
        TargetForm.MinimizeBox = False
        TargetForm.WindowState = FormWindowState.Maximized
        TargetForm.Show()
        CurrentForm.Close()
        TargetForm.ResumeLayout()
    End Sub

    Public Sub openChild(ChildForm As Form, CurrentForm As Form)
        For i = CurrentForm.MdiChildren.Length - 1 To 0 Step -1
            CurrentForm.MdiChildren(i).Close()
        Next
        ChildForm.SuspendLayout()
        ChildForm.MdiParent = CurrentForm
        ChildForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedToolWindow
        ChildForm.ForeColor = Color.Black
        ChildForm.BackColor = Color.White
        ChildForm.ShowIcon = False
        ChildForm.ShowInTaskbar = False
        ChildForm.MaximizeBox = False
        ChildForm.MinimizeBox = False
        ChildForm.ControlBox = False
        ChildForm.WindowState = FormWindowState.Maximized
        ChildForm.Show()
        ChildForm.ResumeLayout()
    End Sub

    Public Sub reDesign(CurrentForm As Form)
        CurrentForm.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedToolWindow
        CurrentForm.ForeColor = Color.Black
        CurrentForm.BackColor = Color.White
        CurrentForm.ShowIcon = False
        CurrentForm.ShowInTaskbar = False
        CurrentForm.MaximizeBox = False
        CurrentForm.MinimizeBox = False
        CurrentForm.ControlBox = False
        CurrentForm.WindowState = FormWindowState.Maximized
    End Sub
End Class
